<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                xmlns:component="http://java.sun.com/jsf/composite/component"
                template="/templates/template.xhtml">

    <ui:define name="title">财务收款核对</ui:define>
    <ui:define name="content">
        <h:form id="form">
            <div class="ui-g ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12 ">
                    <div class="ui-g-12 card">
                        <div class="ui-g-12">
                            <h1>收款信息</h1>
                        </div>
                        <div class="ui-g-12">

                            <div class="ui-g-2">
                                <p:outputLabel value="实收日期"/>
                            </div>
                            <div class="ui-g-4">

                                <p:calendar id="actualDate" value="#{cwBackMoneyBean.$.actualDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="实收金额"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.$.actualMoney}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="应收日期"/>
                            </div>
                            <div class="ui-g-4">

                                <p:calendar id="receiveDate" value="#{cwBackMoneyBean.$.moneyFlowDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"
                                            disabled="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="应收金额"/>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.$.moneyFlowNum}" readonly="true"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款账户"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.$.receiveAccountName}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款账号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.$.receiveAccount}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款凭证"/>
                            </div>
                            <div class="ui-g-4">
                                <!--没有上传过文件显示-->
                                <p:outputPanel id="filepanel">
                                    <div style="display: flex;align-items: center;">

                                        <p:fileUpload fileUploadListener="#{cwBackMoneyBean.fileUpload}"
                                                      mode="advanced"
                                                      update="messages,filepanel,upImage" auto="true" process="@this"
                                                      allowTypes="/(\.|\/)(gif|jpe?g|png)$/" label="上传"
                                                      rendered="#{cwBackMoneyBean.$.pingzhengUrl==null}"/>

                                        <p:commandButton value="查看" style="margin-right: 2%"
                                                         process="@this"
                                                         onclick="PF('upImage').show()"
                                                         rendered="#{cwBackMoneyBean.$.pingzhengUrl!=null}"/>


                                        <p:fileUpload fileUploadListener="#{cwBackMoneyBean.fileUpload}"
                                                      mode="advanced"
                                                      update="messages,filepanel,upImage" auto="true" process="@this"
                                                      allowTypes="/(\.|\/)(gif|jpe?g|png)$/" label="重新上传"
                                                      rendered="#{cwBackMoneyBean.$.pingzhengUrl!=null}"
                                                      disabled="true"/>

                                        <p:growl id="messages" showDetail="true"/>
                                    </div>
                                </p:outputPanel>
                            </div>
                        </div>

                        <div class="ui-g-12">
                            <h1>出票信息</h1>
                        </div>
                        <div class="ui-g-12">
                            <div class="ui-g-2">
                                <p:outputLabel value="快递单号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.cwOutTicketInfo.courierNumber}" readonly="true"/>
                            </div>
                            <div class="ui-g-6"/>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件人姓名"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.cwOutTicketInfo.sendManName}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="签收日期"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.cwOutTicketInfo.receiveDate}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件人手机号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.cwOutTicketInfo.sendManMobile}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件日期"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.cwOutTicketInfo.sendDate}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="开票凭证上传"/>
                            </div>
                            <div class="ui-g-4">

                                <p:commandButton value="查看"
                                                 process="@this"
                                                 onclick="PF('otImage').show()"
                                                 rendered="#{cwBackMoneyBean.cwOutTicketInfo.outTicketUrl!=null}"/>

                            </div>
                        </div>

                    </div>
                </div>
                <div class="ui-g-12">
                    <div class="ui-g-12 card">
                        <h1>本周数据</h1>
                        <p:dataTable id="jfBackDataTable"
                                     style="width: 100%"
                                     var="jfSltBackData"
                                     value="#{cwBackMoneyBean.jfSltBackDataList}"
                                     rows="#{constants:get('ROWS')}"
                                     lazy="true"
                                     paginator="true"
                                     paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                     rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                     emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                     reflow="true"
                                     resizableColumns="true">


                            <p:column headerText="开始日期">
                                <h:outputText value="#{jfSltBackData.beginDate}">
                                    <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                </h:outputText>
                            </p:column>

                            <p:column headerText="结束日期">
                                <h:outputText value="#{jfSltBackData.endDate}">
                                    <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="结算类型">
                                <h:outputText value="#{jfSltBackData.type==0?'日结':'周结'}"/>
                            </p:column>
                            <p:column headerText="推广渠道">
                                <h:selectOneMenu value="#{jfSltBackData.markChannel}" style="width:100%" disabled="true">
                                    <f:selectItems value="#{cwBackMoneyBean.dictionaries[DictionaryCode.SETTLEMENT_SPREAD_CHANNEL]}"
                                                   var="dic"
                                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </h:selectOneMenu>
                            </p:column>

                            <p:column headerText="注册数"
                                      rendered="#{cwBackMoneyBean.companyInfo.copMode==0 or cwBackMoneyBean.companyInfo.copMode==3}">

                                <h:outputText
                                        value="#{jfSltBackData.registerNum}"/>
                            </p:column>

                            <p:column headerText="点击数" rendered="#{cwBackMoneyBean.companyInfo.copMode==2}">

                                <h:outputText
                                        value="#{jfSltBackData.clickNum}"/>
                            </p:column>

                            <p:column headerText="放款总金额"
                                      rendered="#{cwBackMoneyBean.companyInfo.copMode==1 or cwBackMoneyBean.companyInfo.copMode==3}">

                                <h:outputText
                                        value="#{jfSltBackData.lendMoney}"/>
                            </p:column>

                            <p:column headerText="结算金额">

                                <h:outputText value="#{jfSltBackData.sltMoney}"/>
                            </p:column>
                            <p:column headerText="创建时间">
                                <h:outputText value="#{jfSltBackData.createTime}"/>
                            </p:column>
                            <p:column headerText="创建人">
                                <h:outputText value="#{jfSltBackData.createMan}"/>
                            </p:column>

                            <p:column headerText="备注">
                                <h:outputText value="#{jfSltBackData.remark}"/>
                            </p:column>

                        </p:dataTable>


                        <!-- 这里是信息-->
                        <div class="ui-g" style="margin-top: 2%">
                            <div class="ui-g-12"><h3><b>公司信息</b></h3></div>
                            <div class="ui-g-2">
                                <p:outputLabel value="甲方公司名称"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.companyName}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="合作模式"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="copMode" value="#{cwBackMoneyBean.companyInfo.copMode}"
                                                 disabled="true">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{cwBackMoneyBean.dictionaries[DictionaryCode.COOPERATION_MODE]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>

                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="产品名称"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:chips id="advantageTag" value="#{cwBackMoneyBean.productNames}"
                                         disabled="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="纳税识别号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.taxIdentificationNumber}"
                                             readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="公司背景"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="companyBackground"
                                                 value="#{cwBackMoneyBean.companyInfo.companyBackground}"
                                                 disabled="true">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{cwBackMoneyBean.dictionaries[DictionaryCode.COMPANY_BACKGROUND]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="公司固话"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.companyPhone}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="商务姓名"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.contactName}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="商务电话"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.contactPhone}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="负责人"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.principal}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="审核人员"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.auditor}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="是否一般纳税人"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputSwitch id="ifGeneralTaxpayer" onLabel="是" offLabel="否" disabled="true"
                                               value="#{cwBackMoneyBean.companyInfo.ifGeneralTaxpayer}"
                                               readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="审核方式"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="verifyMode" value="#{cwBackMoneyBean.companyInfo.verifyMode}"
                                                 disabled="true">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems value="#{cwBackMoneyBean.dictionaries[DictionaryCode.APPROVAL_TYPE]}"
                                                   var="dic"
                                                   itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>

                            <div class="ui-g-12"><h3><b>结算信息</b></h3></div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算价格"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.settlementPriceCps}"
                                                 readonly="true"/>
                                    <span class="input-group-addon">%</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算价格"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.settlementPriceCpa}"
                                                 readonly="true"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算周期"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="settlementPeroid"
                                                 value="#{cwBackMoneyBean.companyInfo.settlementPeroid}"
                                                 disabled="true">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{cwBackMoneyBean.dictionaries[DictionaryCode.SETTLEMENT_CYCLE]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="结算账期"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.settlementPaymentPeroid}"
                                                 readonly="true"/>
                                    <span class="input-group-addon">工作日</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="预付金额"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.taxIdentificationNumber}"
                                                 readonly="true"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="我司收款账户"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.receivableAccount}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="我司收款卡号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.receivableCardNumber}"
                                             readonly="true"/>
                            </div>

                            <div class="ui-g-12"><h3><b>开票信息</b></h3></div>

                            <!--不开票显示内容-->
                            <p:outputPanel rendered="#{cwBackMoneyBean.companyInfo.ifInvoice == false}">

                                <div class="ui-g-5">
                                    <p:outputLabel value="是否开发票"/>
                                    <strong style="color: red">*</strong>
                                </div>
                                <div class="ui-g-4">
                                    <p:inputSwitch id="ifInvoice" onLabel="是" offLabel="否"
                                                   value="#{cwBackMoneyBean.companyInfo.ifInvoice}"
                                                   disabled="true">
                                    </p:inputSwitch>
                                </div>

                                <div class="ui-g-5">
                                    <p:outputLabel value="打款人姓名"/>
                                    <strong style="color: red">*</strong>
                                </div>
                                <div class="ui-g-4">
                                    <div class="input-group">
                                        <p:inputText value="#{cwBackMoneyBean.companyInfo.payer}" readonly="true"/>
                                    </div>
                                </div>

                            </p:outputPanel>

                            <p:outputLabel rendered="#{cwBackMoneyBean.companyInfo.ifInvoice == true}">
                            <div class="ui-g-2">
                                <p:outputLabel value="开票内容"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:selectOneMenu id="invoiceContent"
                                                     value="#{cwBackMoneyBean.companyInfo.invoiceContent}"
                                                     disabled="true">
                                        <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                      noSelectionOption="true"/>
                                        <f:selectItems
                                                value="#{cwBackMoneyBean.dictionaries[DictionaryCode.SETTLEMENT_BILLING_CONTENT]}"
                                                var="dic"
                                                itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                    </p:selectOneMenu>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="开户支行姓名"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.firstPartyBank}" readonly="true"/>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="银行账户名"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{cwBackMoneyBean.companyInfo.firstPartyAccount}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="银行卡号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.firstPartyCardNumber}"
                                                 readonly="true"/>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="开票地址"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.invoiceAddress}" readonly="true"/>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收件人姓名"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.recipientsName}" readonly="true"/>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收件人手机号"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.recipientsMobile}"
                                                 readonly="true"/>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收件地址"/>
                                <strong style="color: red">*</strong>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{cwBackMoneyBean.companyInfo.deliveryAddress}"
                                                 readonly="true"/>
                                </div>
                            </div>
                            </p:outputLabel>
                            
                            <component:workflow-basic workflowBean="#{cwBackMoneyBean}"/>

                        </div>

                    </div>

                </div>
            </div>

            <p:dialog widgetVar="upImage" modal="true" resizable="false" showEffect="clip" hideEffect="clip">
                <h:graphicImage id="upImage" url="#{cwBackMoneyBean.$.pingzhengUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="otImage" modal="true" resizable="false" showEffect="clip" hideEffect="clip">
                <h:graphicImage id="otImage" url="#{cwBackMoneyBean.cwOutTicketInfo.outTicketUrl}"/>
            </p:dialog>

        </h:form>
    </ui:define>
</ui:composition>
